home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 January to June / Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64 / air assault (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  6KB  |  146 lines

  1. 10 rem--ahoy--may issue--air assault----prog page 35
  2. 100 rem ** a i r  a s s a u l t **
  3. 110 rem ** designed by: bob lloret **
  4. 120 rem ***  for ahoy magazines  ***
  5. 130 rem -----------------------------
  6. 160 print "[147]":poke 53280,0:poke 53281,4
  7. 170 print tab(17);"[158]a i r"
  8. 180 print tab(13);"a s s a u l t"
  9. 190 print tab(14);"designed by:"
  10. 200 print tab(15);"bob lloret"
  11. 210 print tab(10);"[144]press [f1] to start"
  12. 220 get a$:if a$="[133]" then 230
  13. 225 goto 220
  14. 230 print "[147]":poke 53280,0:poke 53281,0:clr:c=c+1
  15. 240 print "[154]    hold on....i am building the city.":if c>1 then 260
  16. 250 goto 700
  17. 260 gosub 590
  18. 270 gosub 1000
  19. 280 rem *****  main loop  *****
  20. 285 rem =======================
  21. 310 si=54272:for n=0 to 24:poke si+n,0:next n
  22. 320 poke si+24,3:pokesi+5,0:pokesi+6,255:bomb=140
  23. 325 y=40:xpl=1944:hb=56216:x1=130:y1=175:poke v+6,x1:poke v+7,y1:poke v+21,8
  24. 326 for d=1 to 1000:next d
  25. 328 if b>39 then poke v+21,0:goto 1200
  26. 330 x=int(rnd(0)*235)+20:sp=int(rnd(0)*5)+6:b=b+1:print tab(33);"[145][145][145][145][145]";b
  27. 335 print tab(33);"";namt:print "[145][145]"
  28. 360 js=peek(56321):f1=jsand16:js=15-(jsand15):bomb=bomb-2
  29. 365 if js=1 then y1=y1-7:if y1<=100 then y1=100
  30. 370 if js=2 then y1=y1+7:if y1>=190 then y1=190
  31. 375 if js=4 then x1=x1-7:if x1<=20 then x1=20
  32. 380 if js=8 then x1=x1+7:if x1>=255 then x1=255
  33. 381 poke v+21,12:poke v+6,x1:poke v+7,y1
  34. 385 if peek(v+30)andx=x and f1=0 then ch=int(x/9):rh=int(y/11):goto420
  35. 390 y=y+sp:poke v+4,x:poke v+5,y:poke si,bomb:poke si+1,bomb:poke si+4,17
  36. 400 if y>=226 then y=40:hit=int(x/8):pokesi+4,16:pokesi+1,0:pokesi,0:goto 480
  37. 410 goto 360
  38. 415 rem ****  shot down  ****
  39. 416 rem =====================
  40. 420 poke si+4,16:poke si+1,0:poke si,0:poke si+5,11:poke v+21,8:poke 53281,2
  41. 430 yb=1024+ch+40*rh:xb=55296+ch+40*rh
  42. 435 poke xb,7:poke xb+1,7:poke xb+40,7:poke xb+41,7
  43. 440 poke yb,41:poke yb+1,42:poke yb+40,43:poke yb+41,44
  44. 450 for a=15to4 step-.6:pokesi+24,a:pokesi+4,129:pokesi+1,3:pokesi,50:next a
  45. 460 ford=1 to 200:next d:pokesi+4,16:pokesi+1,0:pokesi,0
  46. 465 poke yb,32:poke yb+1,32:poke yb+40,32:poke yb+41,32
  47. 470 poke 53281,6:y=40:bomb=140
  48. 472 if y<22 or y>20 then amt=10
  49. 474 if y<19 or y>17 then amt=30
  50. 476 if y<=16 then amt=75
  51. 477 namt=namt+amt:t=t+1:goto 328
  52. 478 rem ****  hit building  ****
  53. 479 rem ========================
  54. 480 poke si+5,11:pokev+21,8:poke53281,2
  55. 490 poke hb+hit-2,7:poke hb+hit-1,7:poke hb+hit,7
  56. 500 poke hb+40+hit-2,7:poke hb+40+hit-1,7:poke hb+40+hit,7
  57. 501 fora=15to 9step-.4:pokesi+24,a:pokesi+4,129:pokesi+1,1:pokesi,30:next a
  58. 502 poke xpl+hit-2,35:poke xpl+hit-1,36:poke xpl+hit,33
  59. 505 poke xpl+40+hit-2,38:poke xpl+40+hit-1,39:poke xpl+40+hit,40
  60. 510 for d=1 to 200:next d:poke 53281,7
  61. 515 poke hb+hit-2,1:poke hb+hit-1,1:poke hb+hit,1
  62. 520 poke hb+40+hit-2,1:poke hb+40+hit-1,1:poke hb+40+hit,1:ford=1to200:next
  63. 525 poke hb+hit-2,2:poke hb+hit-1,2:poke hb+hit,2
  64. 530 poke hb+40+hit-2,2:poke hb+40+hit-1,2:poke hb+40+hit,2:ford=1to200:next
  65. 535 poke 53281,6:poke xpl+hit-2,32:poke xpl+hit-1,32:poke xpl+hit,32
  66. 540 poke xpl+40+hit-2,32:poke xpl+40+hit-1,32:poke xpl+40+hit,32
  67. 550 poke v+5,y:bomb=140:pokesi+4,16:pokesi+1,0:pokesi,0
  68. 560 for a=1984 to 2023:ck=peek(a):if ck=32 then next a:pokev+21,0:goto 1200
  69. 570 goto 328
  70. 590 rem ****  main screen  ****
  71. 591 rem =======================
  72. 594 print "[147]":print tab(9);"[193] air assault [193]"
  73. 595 a1=55328:for row=1 to 25:for s=a1 to a1+7:poke s,0:next s:a1=a1+40:next row
  74. 600 a=1056:for row=1 to 25:for s=a to a+7:poke s,45:next s:a=a+40:next row
  75. 605 poke 53280,0:poke 53281,6
  76. 610 print tab(33);"bombs:":print tab(33);"score:":print
  77. 620 for a=56216 to 56247:c=int(rnd(0)*5)+1:poke a,c:poke a+40,c:next a
  78. 640 for a=1944 to 1975:read bld:poke a,bld:next a
  79. 650 for a=1984 to 2015:read bld:poke a,bld:next a
  80. 660 return
  81. 698 rem **** move char. set ****
  82. 699 rem ========================
  83. 700 print chr$(142):poke 52,48:poke 56,48:clr
  84. 710 poke 56334,peek(56334)and254
  85. 720 poke 1,peek(1)and251
  86. 730 for i=0 to 511:poke i+12288,peek(i+53248):next
  87. 740 poke 1,peek(1)or4:poke 56334,peek(56334)or1
  88. 750 poke 53272,(peek(53272)and240)+12
  89. 758 rem **** redefine char ****
  90. 759 rem =======================
  91. 760 read loc:if loc=-1 then 260
  92. 770 for a=0 to 7:read numb:poke loc+a,numb:next a
  93. 780 goto 760
  94. 790 data 12504,0,8,8,28,62,125,255,231
  95. 800 data 12512,0,0,0,0,0,255,153,153
  96. 810 data 12520,224,224,224,224,224,255,255,231
  97. 820 data 12528,56,56,56,56,56,255,153,153
  98. 825 data 12536,3,3,3,3,3,3,255,255
  99. 830 data 12584,255,255,255,255,153,153,255,255
  100. 835 data 12568,240,118,60,30,143,199,227,241
  101. 840 data 12576,255,126,60,24,129,195,232,255
  102. 845 data 12552,15,30,60,118,241,227,199,143
  103. 850 data 12592,118,60,30,143,199,99,49,56
  104. 855 data 12600,255,126,60,24,129,195,232,231
  105. 860 data 12608,30,60,118,241,227,198,140,28
  106. 870 data 12616,100,52,132,194,98,48,24,0
  107. 880 data 12624,64,70,142,156,176,0,0,31
  108. 890 data 12632,32,100,200,128,24,48,96,192
  109. 900 data 12640,192,204,102,99,0,128,152,132
  110. 910 data 12648,255,255,255,255,255,255,255,255,-1
  111. 948 rem ****  building data  ****
  112. 949 rem =========================
  113. 950 data 28,27,30,28,31,29,27,37,28,30,29,37,37,29,27,27,28,37,30,30
  114. 960 data 31,27,37,29,28,27,30,27,27,28,37,37
  115. 970 data 37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37
  116. 980 data 37,37,37,37,37,37,37,37,37,37,37,37
  117. 997 rem
  118. 998 rem **** create sprites ****
  119. 999 rem ========================
  120. 1000 v=53248:poke 2042,13:poke 2043,14:poke v+41,0:poke v+42,1
  121. 1010 for n=0 to 62:read q:poke 832+n,q:next n
  122. 1020 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,15,248
  123. 1030 data 14,31,252,15,255,254,15,255,254,14,31,252,12,15,248
  124. 1040 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  125. 1050 for n=0 to 62:read q:poke 896+n,q:next n
  126. 1060 data 0,0,0,0,0,0,0,0,0,0,0,0,3,128,224,2,0,32,2,8,32,0,8,0,0,8,0,0,0,0
  127. 1070 data 0,227,128,0,0,0,0,8,0,0,8,0,2,8,32,2,0,32,3,128,224
  128. 1080 data 0,0,0,0,0,0,0,0,0,0,0,0
  129. 1100 return
  130. 1200 print "[147]":poke 53280,6:poke 53281,15:poke si,16:poke si+1,0:poke si,0
  131. 1210 print tab(4);"the following are the results of"
  132. 1220 print "  the enemy assault...."
  133. 1225 for d=1 to 2000:next d
  134. 1230 print tab(1);"bombs dropped............";b
  135. 1240 print tab(1);"bombs deflected..........";t:dh=b-t
  136. 1250 print tab(1);"direct hits..............";dh
  137. 1260 if dh>=8 then msg$="total devestation":mg$="total anihilation":goto 1280
  138. 1270 msg$="partial destuction":mg$="few casualties"
  139. 1280 print tab(1);"structure damage...";msg$
  140. 1290 print tab(1);"population.........";mg$
  141. 1295 if namt>=hy then hy=namt
  142. 1300 print tab(1);"your score...............";hy
  143. 1320 print tab(9);"[156]press fire to try again":clr
  144. 1325 wait 145,16,16
  145. 1330 poke v+21,0:goto 230
  146.